<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:p="http://primefaces.org/ui"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ul class="nav nav-list bs-docs-sidenav affix">
        <c:if test="#{sessionController.getPermissao('Painel de Controle')}">
            <li class="#{(facesUtilController.paginaAtual == '/index.xhtml') ? 'active' : ''}">
                <a href="/EHomeWebApplication/index.jsf">
                    <i class="icon-home"></i>
                    Painel de Controle
                    <i class="icon-chevron-right"></i>
                </a>
            </li>
        </c:if>

        <c:if test="#{sessionController.getPermissao('Mensagens')}">
            <li class="#{(facesUtilController.paginaAtual == '/menu/mensagens.xhtml') ? 'active' : ''}">
                <a href="/EHomeWebApplication/menu/mensagens.jsf">
                    <i class="icon-envelope"></i>
                    Mensagens
                    <i class="icon-chevron-right"></i>
                </a>
            </li>
        </c:if>

        <c:if test="#{sessionController.getPermissao('Histórico')}">
            <li class="#{(facesUtilController.paginaAtual == '/menu/historico.xhtml') ? 'active' : ''}">
                <a href="/EHomeWebApplication/menu/historico.jsf">
                    <i class="icon-time"></i>
                    Histórico
                    <i class="icon-chevron-right"></i>
                </a>
            </li>
        </c:if>

        <c:if test="#{sessionController.getPermissao('Grupos de Usuários')
                      or sessionController.getPermissao('Usuários')}">
            <li class="nav-header">
                Usuários
            </li>
        </c:if>

        <c:if test="#{sessionController.getPermissao('Grupos de Usuários')}">
            <li class="#{(facesUtilController.paginaAtual == '/menu/gruposUsuarios.xhtml') ? 'active' : ''}">
                <a href="/EHomeWebApplication/menu/gruposUsuarios.jsf">
                    <i class="icon-user"></i>
                    Grupos de Usuários
                    <i class="icon-chevron-right"></i>
                </a>
            </li>
        </c:if>

        <c:if test="#{sessionController.getPermissao('Usuários')}">
            <li class="#{(facesUtilController.paginaAtual == '/menu/usuarios.xhtml') ? 'active' : ''}">
                <a href="/EHomeWebApplication/menu/usuarios.jsf">
                    <i class="icon-user"></i>
                    Usuários
                    <i class="icon-chevron-right"></i>
                </a>
            </li>
        </c:if>

        <c:if test="#{sessionController.usuarioLogado != null
                      and sessionController.usuarioLogado.usuCodigo eq 0}">
            <li class="nav-header">
                Ações
            </li>
            <li class="#{(facesUtilController.paginaAtual == '/menu/gruposAcoes.xhtml') ? 'active' : ''}">
                <a href="/EHomeWebApplication/menu/gruposAcoes.jsf">
                    <i class="icon-exclamation-sign"></i>
                    Grupos de Ações
                    <i class="icon-chevron-right"></i>
                </a>
            </li>
            <li class="#{(facesUtilController.paginaAtual == '/menu/acoes.xhtml') ? 'active' : ''}">
                <a href="/EHomeWebApplication/menu/acoes.jsf">
                    <i class="icon-exclamation-sign"></i>
                    Ações
                    <i class="icon-chevron-right"></i>
                </a>
            </li>
            <li class="nav-header">
                Configurações
            </li>
            <li class="#{(facesUtilController.paginaAtual == '/menu/configuracoes.xhtml') ? 'active' : ''}">
                <a href="/EHomeWebApplication/menu/configuracoes.jsf">
                    <i class="icon-wrench"></i>
                    Configurações
                    <i class="icon-chevron-right"></i>
                </a>
            </li>
        </c:if>
    </ul>
</ui:fragment>